﻿using mds.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace mds.LoginSecurityService
{
    internal class LoginItemService
    {
           private static LoginItemService _instance = new LoginItemService();
           private LoginItem _Configuration;

        public static LoginItemService Instance
        {
            get { return _instance; }         
        }
        private LoginItemService()
        {
            //_Configuration = ConfigurationAdapter.Instance.GetConfigItem<LoginItem>("LoginSecurityService");
        }
        public LoginItem GetConfig()
        {
            return _Configuration;
        }
        internal RedisConnection GetConnection(String connectionName)
        {
            RedisConnection connection=new RedisConnection();
            _Configuration.DatabaseConnection.ForEach(a => {
                if (a.RedisName == connectionName)
                    connection = a;
            });
            return connection;
        }
    }
}
